<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>조립PC의 대명사- PC Master~!~!</title>
<script>
function changeCheck(id,status){
	location.href="/web/member/statusChange?changeId=" +id+ "&changeStatus=" +status;
	
}
function search(){
	var searchWord = document.searchForm.searchWord.value;
	if(searchWord.lenght ==0 ){
		alert('검색어를 입력해주세요');
		return false;
	}
	document.searchForm.searchWord.value.trim();
	document.searchForm.submit();	
}
</script>
</head>
<body>

<!-- 상단 로그인 패널을 include로 삽입 -->
<div style="position:absolute; left:50%; top:0px; width:1200px; height:80px; margin-left:-600px;z-index:1 ">
<%@ include file="../loginPanel.jsp" %>
</div>

<!-- 상단 및 좌측 메뉴(카테고리)리스트를 include로 삽입 -->
<div style="position:absolute; left:50%; top:0px; width:1200px; height:80px; margin-left:-600px;">
<%@ include file="../top.jsp" %>
</div>

<div style="position:absolute; left:50%; top:160px; width:1000px; height:80px; margin-left:-400px;">
<!--------------------------------------여기다가 각자 삽입------------------------------------>
	<!-- 타이틀 -->
	<table style="margin-left:30px; margin-top:30px" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td><img src="/web/resources/images/bar_t_line.gif" border="0" alt="" /></td>
			<td style="color:333333;font-size:14px;font-weight:bold;">회원 목록</td>
		</tr>
	</table>	  
	<table style="margin-left:30px; margin-top:30px" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td>
				<input type="button" value="전체회원" onclick="location.href='/web/member/list?status=4'" />
				<input type="button" value="일반회원" onclick="location.href='/web/member/list?status=1'" />
				<input type="button" value="탈퇴회원" onclick="location.href='/web/member/list?status=0'" />
				<input type="button" value="운영진" onclick="location.href='/web/member/list?status=2'" />
			</td>
		</tr>
	</table>
	<table width="900px" border="0" cellspacing="0" cellpadding="0" style="margin-top:5;">
        <tr>
          <td bgcolor="f7f7f7" height="24">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr align="center">
                <td width="150" style="padding:4px 0px 4px 0px; color:#000000; font-weight:bold; font-size:11px;">아이디</td>
                <td width="150" style="padding:4px 0px 4px 0px; color:#000000; font-weight:bold; font-size:11px;">이름</td>
                <td width="200" style="padding:4px 0px 4px 0px; color:#000000; font-weight:bold; font-size:11px;">이메일 & SMS</td>
                <td width="100" style="padding:4px 0px 4px 0px; color:#000000; font-weight:bold; font-size:11px;">적립금</td>
                <td width="150" style="padding:4px 0px 4px 0px; color:#000000; font-weight:bold; font-size:11px;">가입일</td>
                <td width="200" style="padding:4px 0px 4px 0px; color:#000000; font-weight:bold; font-size:11px;">상태</td>
              </tr>
            </table>
          </td>
        </tr>
    </table>
	<!-- 타이틀 끝 -->      
   
        <c:if test="${memberList.size() == 0}">
        	<td align="center">리스트 없다</td>
        </c:if>
        
        <!-- 리스트 -->
        <c:if test="${memberList.size() !=0 }">
            <table width="900px" border="0" cellspacing="0" cellpadding="0" style="margin-top:5px;">
              <c:forEach items="${memberList }" var="list" varStatus="cnt" >
             
               <tr onMouseOver="this.style.backgroundColor='F0F0F0';" 
               	   onMouseOut="this.style.backgroundColor='';" bgcolor="FFFFFF" align="center">

                <td align="center" width="150" style="padding:4px 0px 4px 0px; color:#4C4C4C; font-size:13px;">
                	${list.member_id }</td>
                <td align="center" width="150" style="padding:4px 0px 4px 0px; color:#4C4C4C; font-size:13px;">
                	${list.member_name }</td>
                <td align="center" width="200" style="padding:4px 0px 4px 0px; color:#4C4C4C; font-size:13px;">
					E-Mail
					<c:if test="${list.member_smsyn == 1}" >			
					<input type="checkbox" id="email" checked onclick="return false;"/>
					</c:if>
					<c:if test="${list.member_smsyn != 1}" >			
					<input type="checkbox" id="email" onclick="return false;"/>
					</c:if>
					SMS
					<c:if test="${list.member_emailyn == 1}" >
					<input type="checkbox" id="email" checked onclick="return false;"/>
					</c:if>
					<c:if test="${list.member_emailyn != 1}" >
					<input type="checkbox" id="email" onclick="return false;"/>
					</c:if>					
				</td>
                <td align="center" width="100" style="padding:4px 0px 4px 0px; color:#4C4C4C; font-size:13px;">
					${list.member_savemoney }</td>
                <td align="center" width="150" style="padding:4px 0px 4px 0px; color:#4C4C4C; font-size:13px;">
					${list.member_date }</td>
                <td align="center" width="200" style="padding:4px 0px 4px 0px; color:#4C4C4C; font-size:13px;">
                	
                	<c:if test="${list.member_status == 0}">
                		<input type="button" value="일반" onclick="changeCheck('${list.member_id }','1' )"/>
                		<input type="button" value="운영진" onclick="changeCheck('${list.member_id }','2' )"/>
                	</c:if>
                	
                	<c:if test="${list.member_status == 1}">
                		<input type="button" value="탈퇴" onclick="changeCheck('${list.member_id }','0' )"/>
                		<input type="button" value="운영진" onclick="changeCheck('${list.member_id }','2' )"/>
                	</c:if>
                	
                	<c:if test="${list.member_status == 2}">
                		<input type="button" value="탈퇴" onclick="changeCheck('${list.member_id }','0' )"/>
                		<input type="button" value="일반" onclick="changeCheck('${list.member_id }','1' )"/>
                	</c:if>
                </td>
              </c:forEach>
            </table>
        </c:if>
      <!-- 리스트 끝 --><br>
      <!-- 페이지 처리 -->
      <table width="900px" border="0" cellspacing="0" cellpadding="0" style="margin-top:5px;">
      	<tr>
      		<td>
      			<%@ include file="/WEB-INF/views/member/page_inc.jsp" %>
      		</td>
      	</tr>
      </table>
      <!-- 페이지 처리 끝 -->
	  <!-- 검색 -->
      <form name="searchForm" action="/web/member/list" method="get">  	 
      <input type="hidden" name="status" value="${status }" />
      <table width="300" border="0" cellspacing="0" cellpadding="0" style="margin-left:600px; margin-top:5px;">
      	<tr>
      		<td>
      			<input type="text" name="searchWord" value="" style="border:1; color:#c0c0c0; height:15px;">      	
      		</td>
      		<td>
      			<input type="button" value="검색" onclick="search()"/> 
      		</td>
      	</tr>
      </table>
      </form>   
<!--------------------------------------   삽입 끝       ------------------------------------>
</div> 

<!-- 하단 이용약관, 고객센터, 회사정보 등의 정보를 include로 삽입 -->
<div style="position:absolute; left:0; top:1200px; width:100%; height:80px; ">
<%@ include file="../bottom.jsp"%>
</div>
</body>
</html>